package com.seaboxdata.util;

import lombok.extern.slf4j.Slf4j;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.io.SAXReader;

import java.io.InputStream;

/**
 * @author
 * @create 2020-08-24 14:35
 **/
@Slf4j
public class XmlUtil {
    public static Document readXml(String xmlPath) {
        InputStream resourceAsStream = XmlUtil.class.getClassLoader().getResourceAsStream(xmlPath);
        SAXReader saxReader = new SAXReader();
        Document doc = null;
        try {
            doc = saxReader.read(resourceAsStream);
        } catch (DocumentException e) {
            e.printStackTrace();
        }

        return doc;
    }
}
